package com.lws.hellojms.module.jms;

import org.springframework.jms.core.MessageCreator;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

/**
 * Created by Administrator on 2016/3/14.
 */
public class MessageFactory {

    public static MessageCreator createInstance(final String message) {
        return new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                return session.createTextMessage(message);
            }
        };
    }

}
